package com.learn.xiaoha.sqlsession;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * SqlSession
 *
 * @author: cyx_jay
 * @date: 2021/2/2 14:02
 */
public interface SqlSession {

    /**
     * 获取mapper
     * @param tClass
     */
    <T> T getMapper(Class<T> tClass);

    Connection getConnection();

    /**
     * 开启事务
     */
    public void startTransaction() throws SQLException;
    /**
     *回滚事务
     */
    public void rollBack() throws SQLException;
    /**
     * 提交事务
     */
    public void commit() throws SQLException;
    /**
     * 关闭
     */
    public void close() throws SQLException;

}
